package com.fuxian.dao.mybatisImpl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import com.fuxian.dao.ProspectivestudentDao;
import com.fuxian.model.Prospectivestudent;
@Repository
public class ProspectivestudentDaoMybatisImpl implements ProspectivestudentDao {
	@Resource
	private SqlSessionTemplate sqlSessionTemplate;
	public void addProspectivestudent(Prospectivestudent prospectivestudent) {
		sqlSessionTemplate.insert("addProspectivestudent", prospectivestudent);

	}

	public void deleteProspectivestudentById(int id) {
		sqlSessionTemplate.delete("deleteProspectivestudentById", id);

	}

	public void modifyProspectivestudent(Prospectivestudent prospectivestudent) {
		sqlSessionTemplate.update("modifyProspectivestudent", prospectivestudent);

	}

	public List<Prospectivestudent> selectAllProspectivestudent(Map map) {
		List<Prospectivestudent>list=sqlSessionTemplate.selectList("selectAllProspectivestudent", map);
		return list;
	}

	public List<Prospectivestudent> selectProspectivestudentByConsumeId(Map map) {
		List<Prospectivestudent>list=sqlSessionTemplate.selectList("selectProspectivestudentByConsumeId", map);
		return list;
	}

	public Prospectivestudent selectProspectivestudentById(int id) {
		Prospectivestudent prospectivestudent=sqlSessionTemplate.selectOne("selectProspectivestudentById", id);
		return prospectivestudent;
	}

	public List<Prospectivestudent> selectProspectivestudentByLessonId(Map map) {
		List<Prospectivestudent>list=sqlSessionTemplate.selectList("selectProspectivestudentByLessonId", map);
		return list;
	}

	public List<Prospectivestudent> selectProspectivestudentBySchoole(Map map) {
		List<Prospectivestudent>list=sqlSessionTemplate.selectList("selectProspectivestudentBySchoole", map);
		return list;
		
	}

	public int selectProspectivestudentByStatusConut(int status) {
		int n=sqlSessionTemplate.selectOne("selectProspectivestudentByStatusCount", status);
		return n;
	}
	

}
